<?php

namespace app\controller;

use app\BaseController;
use think\facade\Db;

class Goods extends BaseController
{
    public function index() {
        $list = Db::name('think_goods')
        ->where('status', 1)
        ->field('id, name, image, desc, price, linedPrice, stock as count')
        ->select()
        ->toArray();
    return json([
        'code' => 200,
        'msg' => 'success',
        'data' => $list
    ]);
    }
}